package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购记录类
 */
@Data
@ApiModel(value = "采购记录类")
@TableName("t_buy")
public class BuyBean {
    /*
    （采购编号，采购日期（当前时间），供应商名称，采购员真实姓名，采购详情集合）
     */
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_buyId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "采购日期")
    @TableField("b_createDate")
    private LocalDate createDate = LocalDate.now();
    @ApiModelProperty(value = "供应商名称")
    @TableField("b_supplierName")
    private String supplierName;
    @ApiModelProperty(value = "采购员真实姓名")
    @TableField("b_userRealName")
    private String userRealName;
    @ApiModelProperty(value = "采购明细集合")
    @TableField(exist = false)
    private List<BuyInfoBean> buyInfoList;

    public BuyBean() {
    }

    public BuyBean(String supplierName, String userRealName) {
        this.supplierName = supplierName;
        this.userRealName = userRealName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getUserRealName() {
        return userRealName;
    }

    public void setUserRealName(String userRealName) {
        this.userRealName = userRealName;
    }

    public List<BuyInfoBean> getBuyInfoList() {
        return buyInfoList;
    }

    public void setBuyInfoList(List<BuyInfoBean> buyInfoList) {
        this.buyInfoList = buyInfoList;
    }

    @Override
    public String toString() {
        return "\nBuyBean{" +
                "id=" + id +
                ", createDate=" + createDate +
                ", supplierName='" + supplierName + '\'' +
                ", userRealName='" + userRealName + '\'' +
                ", buyInfoList=" + buyInfoList +
                '}';
    }
}
